<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>刮刮乐活动编辑</title>
<link href="${base}/resource/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resource/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resource/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resource/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resource/admin/js/input.js"></script>
<script type="text/javascript" src="${base}/resource/admin/datePicker/WdatePicker.js"></script>
<style type="text/css">
.authorities label {
	min-width: 120px;
	_width: 120px;
	display: block;
	float: left;
	padding-right: 4px;
	_white-space: nowrap;
}
</style>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $selectAll = $("#inputForm .selectAll");
    var $browserButton = $("#bgbrowserButton");
    $browserButton.browser();
    var $browserButton = $("#basebrowserButton");
    $browserButton.browser();
	
	[@flash_message /]
	
	$selectAll.click(function() {
		var $this = $(this);
		var $thisCheckbox = $this.closest("tr").find(":checkbox");
		if ($thisCheckbox.filter(":checked").size() > 0) {
			$thisCheckbox.prop("checked", false);
		} else {
			$thisCheckbox.prop("checked", true);
		}
		return false;
	});
	
	// 表单验证
	$inputForm.validate({
		rules: {
			name: "required",
			authorities: "required",
            virtualCurrency: {
                required: true,
                min: 0
            }
		}
	});
	
});
</script>
</head>
<body>
	<div class="path">
		<a href="${base}/admin/main.do">首页</a> &raquo; 刮刮乐活动编辑
	</div>
	<form id="inputForm" action="update.do" method="post">
		<input type="hidden" name="id" value="${entity.id}" />
        <input type="hidden" name="status" value="${entity.status}" />
		<table class="input">
			<tr>
				<th>
					<span class="requiredField">*</span>名称:
				</th>
				<td>
					<input type="text" name="name" class="text" value="${entity.name}" maxlength="200" />
				</td>
			</tr>
			<tr>
				<th>
					内容:
				</th>
				<td>
					<input type="text" name="content" class="text" value="${entity.content}" maxlength="200" />
				</td>
			</tr>
            <tr>
                <th>
                    备注:
                </th>
                <td>
                    <input type="text" name="bak" class="text" value="${entity.bak}" maxlength="200" />
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>活动类型:
                </th>
                <td>
                    <select name="type" class="text required">
                        <option [#if entity.type==0]selected="selected"  [/#if]  value="0">刮刮乐</option>
                        <option [#if entity.type==1] selected="selected" [/#if] value="1" >大转盘</option>

                    </select>
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>宝币抽奖:
                </th>
                <td>
                    <input type="text" name="virtualCurrency" class="text" value="${entity.virtualCurrency}" maxlength="200" />
                    <span class="requiredField">* 大于0表示支持宝币支付抽奖</span>:
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>开始时间:
                </th>
                <td>
                    <input type="text" id="startDate" name="startDate"  value="${entity.startDate?string("yyyy-MM-dd HH:mm:ss")}" class="text Wdate" readonly="readonly" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss', maxDate: '#F{$dp.$D(\'endDate\')}' });" />
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>结束时间:
                </th>
                <td>
                    <input type="text" id="endDate" name="endDate" class="text Wdate"  value="${entity.endDate?string("yyyy-MM-dd HH:mm:ss")}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss', minDate: '#F{$dp.$D(\'startDate\')}' });"  />
                </td>
            </tr>
			<tr>
                <th>
                    <span class="requiredField">*</span>活动背景图:
                </th>
                <td>
                <span class="fieldSet">
						<input type="text" id="bgPath" name="bgPath" class="text valid"  maxlength="200" value="${entity.bgPath}" required="required">
						<input type="button" id="bgbrowserButton" class="button" value="选择文件">
					</span>
                    <span class="requiredField">* 上传640px,1136px大小图片</span>:
                </td>

			</tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>活动宣传图:
                </th>
                <td>
                <span class="fieldSet">
						<input type="text" id="basePath" name="basePath" class="text valid"  maxlength="200" value="${entity.basePath}" required="required">
						<input type="button" id="basebrowserButton" class="button" value="选择文件">
					</span>
                    <span class="requiredField">* 上传454px,300px大小图片</span>:
                </td>

            </tr>
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="提交" />
					<input type="button" class="button" value="返回" onclick="location.href='list.do'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>